package br.com.firula.to;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="telefone")
@SequenceGenerator(name="SEQUENCE", sequenceName="telefone_seq")
@Inheritance(strategy=InheritanceType.JOINED)
public class TelefoneTO extends BaseTO{

	private static final long serialVersionUID = -5925496147119268634L;

	@Id
	@Column(name="id", nullable=false)
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;

	@Column(name="ddd", nullable=false)
	private Integer ddd;

	@Column(name="telefone", nullable=false)
	private Integer telefone;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idTipoTelefone", nullable = false)
	private TipoTelefoneTO tipoTelefone;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idUsuario", nullable = false)
	private UsuarioBaseTO usuario;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Integer getDdd() {
		return ddd;
	}

	public void setDdd(Integer ddd) {
		this.ddd = ddd;
	}

	public Integer getTelefone() {
		return telefone;
	}

	public void setTelefone(Integer telefone) {
		this.telefone = telefone;
	}

	public TipoTelefoneTO getTipoTelefone() {
		return tipoTelefone;
	}

	public void setTipoTelefone(TipoTelefoneTO tipoTelefone) {
		this.tipoTelefone = tipoTelefone;
	}

	public UsuarioBaseTO getUsuario() {
		return usuario;
	}

	public void setUsuario(UsuarioBaseTO usuario) {
		this.usuario = usuario;
	}

	@Override
	public String getAbreviation() {
		// TODO Auto-generated method stub
		return null;
	}

}
